<?

	include("inc/config.inc.php");
    
	    include("inc/header.inc.php");

	// Get year if passed, otherwise use current
	if (is_numeric($_GET[y]))
		$year = mysqli_real_escape_string($con,$_GET[y]);
	else
		$year = date("Y");

	// Get month if passed, otherwise use current - remove any leading zeros - for the calendar function
	if (is_numeric($_GET[m]))
	{
		$month = mysqli_real_escape_string($con,$_GET[m]);
		if (substr($month, 0, 1) == 0)
			$month = substr($month, 1, 1);
	}
	else
		$month = date("n");


	echo "<h2><span class='textColorChange'>$config[systemtitle]</span></h2><br/>\n\n";

        echo "<a href='main.php' style='color:black;font-size:10pt'><< Back</a><br/>";

        echo "<div style='background:#504E52' class='normalText' width='400'>\n";

     
	echo "<b>All Holidays</b><br/><br/>\n";
	
	$nextYear = $year;
	$prevYear = $year;
	$nextMonth = $month+1;
	$prevMonth = $month-1;
	
	if ($prevMonth == 0)
	{
		$prevMonth = 12;
		$prevYear--;
	}
	
	if ($nextMonth == 13)
	{
		$nextMonth = 1;
		$nextYear++;
	}
	
	echo "<a href='calendar.php?m=$prevMonth&y=$prevYear'><b>&lt;&lt</b></a> ";
	echo date("F", mktime(0, 0, 0, $month, 10)) ." $year ";
	echo "<a href='calendar.php?m=$nextMonth&y=$nextYear'><b>&gt;&gt</b></a>";
	echo draw_calendar($month,$year);

	echo "</div>\n";
	echo "\n<br/>\n\n";



	include("inc/footer.inc.php");
    
?>
    
